<?php foreach($rs1 as $r)?>

<p>&nbsp;</p>
<div align="center">
  <h1>ตารางกรอกข้อมูลคุณภาพสินค้า Cut Size</h1>
</div>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="62%" valign="top"><strong>Data Detail<br />
      <br />
      </strong>
      <table width="90%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#94c0d2">
        <tr>
          <td width="11%" height="32" bgcolor="#DAECF4">&nbsp;Type</td>
          <td width="22%" align="center"><?php echo $r['type_of']; ?></td>
          <td width="17%" bgcolor="#DAECF4">&nbsp;Size</td>
          <td width="15%" align="center"><?php echo $r['size']; ?></td>
          <td width="18%" bgcolor="#DAECF4">&nbsp;Date</td>
          <td width="17%" align="center"><?php echo $r['modify_date']; ?></td>
        </tr>
        <tr>
          <td height="30" bgcolor="#DAECF4">&nbsp;Gram</td>
          <td align="center"><?php echo $r['gram']; ?></td>
          <td bgcolor="#DAECF4">&nbsp;Lot No.</td>
          <td align="center"><?php echo $r['lot_no']; ?></td>
          <td bgcolor="#DAECF4">&nbsp;Shift</td>
          <td align="center"><?php echo $r['shift']; ?></td>
        </tr>
        <tr>
          <td height="30" bgcolor="#DAECF4">&nbsp;Brand</td>
          <td align="center"><?php echo $r['brand']; ?></td>
          <td bgcolor="#DAECF4">&nbsp;Position</td>
          <td align="center"><?php echo $r['position']; ?></td>
          <td bgcolor="#DAECF4">&nbsp;</td>
          <td align="center">&nbsp;</td>
        </tr>
        <tr>
          <td height="30" bgcolor="#DAECF4">&nbsp;Grade</td>
          <td align="center"><?php echo $r['grade']; ?></td>
          <td bgcolor="#DAECF4">&nbsp;</td>
          <td align="center">&nbsp;</td>
          <td bgcolor="#DAECF4">&nbsp;</td>
          <td align="center">&nbsp;</td>
        </tr>
        <tr>
          <td height="30" colspan="6" align="center"><?php if($r["status"] == 1)
    { echo "<h2>Status :: <font color=green>Active</font></h2>";} 
    else 
    {
    	echo "<h2>Status :: <font color=red>No Active</font></h2>";
      
     } 
    ?></td>
        </tr>
      </table></td>
    <td width="38%" valign="top"><strong><br />
      <br />
      </strong></td>
  </tr>
</table>
<br />
<table width="99%" align="center" class="font">
  <tr>
    <td><table id="grid">
        <thead>
          <tr>
            <th data-field="Properties_1">Properties Item</th>
            <th data-field="Value_11">Value</th>
            <th data-field="Value_12">Value</th>
            <th data-field="Unit_1">Unit</th>
            <th data-field="Properties_2">Properties Item</th>
            <th data-field="Value_21">Value</th>
            <th data-field="Value_22">Value</th>
            <th data-field="Unit_1">Unit</th>
            <th data-field="Properties_3">Properties Item</th>
            <th data-field="Value_31">Value</th>
            <th data-field="Value_32">Value</th>
            <th data-field="Unit_3">Unit</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>น้ำหนักรวม</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS17')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS17')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>Tons ตัน</td>
            <td>Pen Writing Top</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS42')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS42')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>Plattern No.</td>
            <td>Temp.Thermo.(เปลือกห่อ)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS67')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS67')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>°C</td>
          </tr>
          <tr>
            <td>Basis Weight</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS18')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS18')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>(g/m<sup>2</sup>)</td>
            <td>Pen Writing Bottom</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS43')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS43')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>Plattern No.</td>
            <td><strong>QC</strong></td>
            <td>&nbsp;</td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td>Thickness</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS19')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS19')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>(um)</td>
            <td>Stockigt Top</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS44')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS44')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>Second.</td>
            <td>ฉลากสินค้า(วัน,เวลา,LotNo.)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS68')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS68')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1 = ถูกต้อง,   2= ไม่ถูกต้อง</td>
          </tr>
          <tr>
            <td>Density</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS20')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS20')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>(g/cm<sup>3</sup>)</td>
            <td>Stockigt Bottom</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS45')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS45')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>Second.</td>
            <td>การติดกาวของห่อ</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS69')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS69')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1=พอดี,2=น้อย,3=มาก,  4= กาวติดเนื้อกระดาษ</td>
          </tr>
          <tr>
            <td>Bulk</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS21')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS21')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>(cm<sup>3</sup>/g)</td>
            <td>Coefficent of Friction  Static</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS46')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS46')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>&nbsp;</td>
            <td>การวางแนวเกรนกระดาษ</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS70')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS70')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1=Long grain,2=Shot grain</td>
          </tr>
          <tr>
            <td>Roughness (Top)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS22')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS22')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>ml/min</td>
            <td>Coefficent of Friction  Kinetic</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS47')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS47')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>&nbsp;</td>
            <td>ความแน่นของห่อ ด้านบน</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS71')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS71')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
          </tr>
          <tr>
            <td>Roughness (Bottom)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS23')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS23')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>ml/min</td>
            <td>Flat Curl Before</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS48')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS48')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>ความแน่นของห่อ ด้านล่าง</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS72')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS72')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
          </tr>
          <tr>
            <td>Porosity</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS24')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS24')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>(s./100)</td>
            <td>Hanging Curl Before </td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS49')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS49')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>พื้นที่สกปรก ( Dirt )</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS73')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS73')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>ppm.</td>
          </tr>
          <tr>
            <td>Tensile Strenght MD</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS25')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS25')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>kN/m</td>
            <td>Flat Curl After F</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS50')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS50')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>จำนวนแผ่นสกปรก /45 แผ่น</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS74')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS74')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>แผ่น</td>
          </tr>
          <tr>
            <td>Tensile Strenght CD</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS26')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS26')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>kN/m</td>
            <td>Flat Curl After W</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS51')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS51')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>จำนวนแผ่น (500 แผ่น)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS75')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS75')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>แผ่น</td>
          </tr>
          <tr>
            <td>Tensile Stretch MD</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS27')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS27')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>%</td>
            <td>Flat Curl After F-W</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS52')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS52')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>ลักษณะขุยกระดาษ</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS76')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS76')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>No.</td>
          </tr>
          <tr>
            <td>Tensile Stretch CD</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS28')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS28')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>%</td>
            <td>Flat Curl After W-F</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS53')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS53')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>ขนาดแผ่นกระดาษ</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS77')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS77')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
          </tr>
          <tr>
            <td>Bending Stiffness MD</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS29')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS29')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mN</td>
            <td>Hanging Curl After F</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS54')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS54')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>ฉากกระดาษ ด้านกว้าง</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS78')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS78')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
          </tr>
          <tr>
            <td>Bending Stiffness CD</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS30')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS30')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mN</td>
            <td>Hanging Curl After W</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS55')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS55')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>ฉากกระดาษ ด้านยาว</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS79')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS79')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
          </tr>
          <tr>
            <td>Suf. Electric</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='31')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='31')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>Ohm</td>
            <td>Hanging Curl After F-W</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS56')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS56')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>รอยหยักฟันปลา</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS80')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS80')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
          </tr>
          <tr>
            <td>Water Absorp Top</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS32')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS32')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>(g/m<sup>2</sup>)</td>
            <td>Hanging Curl After W-F</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS57')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS57')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>เฉดสีกระดาษ</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS81')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS81')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1 = ไม่ต่าง,2= แตกต่าง</td>
          </tr>
          <tr>
            <td>Water Absorp Bottom</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='33')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='33')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>(g/m<sup>2</sup>)</td>
            <td>%R/H in room</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS58')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS58')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>%</td>
            <td>รอยตัด B/ F</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS82')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS82')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>No.</td>
          </tr>
          <tr>
            <td>ISO Brightness</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='34')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='34')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>%</td>
            <td>%R/H in ream</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS59')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS59')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>%</td>
            <td>รอยตัด D/ T</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS83')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS83')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>No.</td>
          </tr>
          <tr>
            <td>Opacity</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='35')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='35')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>%</td>
            <td>Weight/ream</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS60')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS60')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>Kg.</td>
            <td>ปัญหาที่พบตามลักษณะ</td>
            <td>&nbsp;</td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td>L*</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS36')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS36')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>&nbsp;</td>
            <td>High/ream</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS61')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS61')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>cm.</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>a*</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS37')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS37')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>&nbsp;</td>
            <td>Temp.หม้อต้มกาว (กล่อง)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS62')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS62')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>°C</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>b*</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS38')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS38')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>&nbsp;</td>
            <td>Temp.Thermo. (กล่อง)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS63')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS63')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>°C</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>CIE Whiteness</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS39')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS39')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>&nbsp;</td>
            <td>Temp.หม้อต้มกาว (ฝา)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='64')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='64')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>°C</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>Moisture content</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS40')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS40')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>%</td>
            <td>Temp.Thermo. (ฝา)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS65')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS65')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>°C</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td>Filler</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS41')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS41')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td>%</td>
            <td>Temp.หม้อต้มกาว(เปลือกห่อ)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS66')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='cutsizeCS66')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>°C</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
        </tbody>
      </table>
    <script>
                $(document).ready(function() {
                    $("#grid").kendoGrid({
						columns: [
						{ field: "Properties_1", width: "30px" },
						{ field: "Value_11", width: "13px" },
						{ field: "Value_12", width: "13px" },
						{ field: "Unit_1",  width: "20px" },
						{ field: "Properties_2", width: "30px" },
						{ field: "Value_21", width: "13px" },
						{ field: "Value_22", width: "13px" },
						{ field: "Unit_12", width: "20px" },
						{ field: "Properties_3", width: "30px" },
						{ field: "Value_31", width: "13px" },
						{ field: "Value_32", width: "13px" },
						{ field: "Unit_3", width: "20px" }

						],
                        //height: 1000,
						//pageable: true,
						dataSource: {
						//pageSize: 12
						} 
                    });
                });
            </script></td>
  </tr>
</table>

<!--scrip list select--> 
<script>
                $(document).ready(function() {
                    var viewModel = {
                        chosenTicket: ko.observable(),
                        resetTicket: function() { this.chosenTicket(null) },
                    };
                    $("#ticket1").kendoDropDownList().trigger("change");
                    $("#ticket2").kendoDropDownList().trigger("change");
                    $("#ticket3").kendoDropDownList().trigger("change");
                    $("#ticket4").kendoDropDownList().trigger("change");
                    $("#ticket5").kendoDropDownList().trigger("change");
					$("#ticket6").kendoDropDownList().trigger("change");
					$("#ticket7").kendoDropDownList().trigger("change");

                });
      		</script> 
<!--scrip วัน-เดือน-ปี--> 
<script>
                $(document).ready(function() {
                    var today = new Date(),
                        birthdays = [
                           +new Date(today.getFullYear(), today.getMonth(), 11),
                           +new Date(today.getFullYear(), today.getMonth() + 1, 6),
                           +new Date(today.getFullYear(), today.getMonth() + 1, 27),
                           +new Date(today.getFullYear(), today.getMonth() - 1, 3),
                           +new Date(today.getFullYear(), today.getMonth() - 2, 22)
                        ];

                    $("#datepicker").kendoDatePicker({
                        value: today,
                        month: {
                            // template for dates in month view
                            content: '# if ($.inArray(+data.date, [' + birthdays + ']) != -1) { #' +
                                         '<div class="birthday"></div>' +
                                     '# } #' +
                                     '#= data.value #'
                        },
                        footer: "Today - #=kendo.toString(data, 'd') #"
                    });

                    $("#datepicker").data("kendoDatePicker")
                                    .dateView.calendar.element
                                    .width(300);
                });
            </script> 
<!--scrip เวลา--> 
<script>
                $(document).ready(function() {
                    // create TimePicker from input HTML element
                    $("#timepicker").kendoTimePicker();
                });
            </script>